home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Broderbund Demo / DemoData / _menu.Dxr / 00001_main movie script.ls next >
Encoding:
Text File  |  1997-09-03  |  11.7 KB  |  307 lines

  1. global gCorpDemo, gPickerPath, gCorpDemoList, gLastDemo, gColorDepth, gCorpVolume, gLivBookButs, gBroderbundButs, gMenuButs, gControlButs, gNavigator, gDemoInfo, gPrintInfo, gDialog, gReturnFrame, gSupplierButs, gBackBut, gMusicPlayer, gKeyboardExit
  2.  
  3. on startMovie
  4.   setPaletteCast()
  5.   if voidp(gCorpDemo) then
  6.     setMonitorDepth("start")
  7.     set gCorpVolume to the soundLevel
  8.     if the soundLevel = 0 then
  9.       set the soundLevel to 1
  10.     end if
  11.     initCorporateGlobals()
  12.   else
  13.     cleanup()
  14.   end if
  15.   set gKeyboardExit to 0
  16.   set the exitLock to 1
  17.   set gLivBookButs to new(script "buttonMan", [10, 11, 12, 13, 14, 15], ["JGMicon", "THicon", "SRBicon", "LMSicon", "HHHicon", "ABicon"])
  18.   setType(gLivBookButs, "radio")
  19.   setDownList(gLivBookButs, ["JGMiconD", "THiconD", "SRBiconD", "LMSiconD", "HHHiconD", "ABiconD"])
  20.   setOverList(gLivBookButs, ["JGMiconR", "THiconR", "SRBiconR", "LMSiconR", "HHHiconR", "ABiconR"])
  21.   setSound(gLivBookButs, "downSound2")
  22.   set gBroderbundButs to new(script "ButtonMan", [10, 11, 12, 13, 14, 15, 16], ["kidpixIcon", "zoombiniIcon", "mathsIcon", "carmenJIcon", "printshopIcon", "carmenIcon", "clickArtIcon"])
  23.   setType(gBroderbundButs, "radio")
  24.   setDownList(gBroderbundButs, ["kidpixIconD", "zoombiniIconD", "mathsIconD", "carmenJIconD", "printshopIconD", "carmenIconD", "clickArtIconD"])
  25.   setOverList(gBroderbundButs, ["kidpixIconR", "zoombiniIconR", "mathsIconR", "carmenJIconR", "printshopIconR", "carmenIconR", "clickArtIconR"])
  26.   setSound(gBroderbundButs, "downSound2")
  27.   set gSupplierButs to new(script "buttonMan", [10, 11, 12, 13], ["RMicon", "SCETicon", "TAGicon", "XemplarIcon"])
  28.   setType(gSupplierButs, "normal")
  29.   setDownList(gSupplierButs, ["RMiconD", "SCETiconD", "TAGiconD", "XemplarIconD"])
  30.   setOverList(gSupplierButs, ["RMiconR", "SCETiconR", "TAGiconR", "XemplarIconR"])
  31.   setSound(gSupplierButs, "downSound2")
  32.   set gBackBut to new(script "buttonMan", [10], ["backIcon"])
  33.   setType(gBackBut, "normal")
  34.   setDownList(gBackBut, ["backIconD"])
  35.   setOverList(gBackBut, ["backIconR"])
  36.   setSound(gBackBut, "downSound2")
  37.   set gControlButs to new(script "buttonMan", [6, 7, 8], ["exitIcon", "printIcon", "demoIcon"])
  38.   setType(gControlButs, "normal")
  39.   setDownList(gControlButs, ["exitIconD", "printIconD", "demoIconD"])
  40.   setOverList(gControlButs, ["exitIconR", "printIconR", "demoIconR"])
  41.   setGreyList(gControlButs, ["exitIconG", "printIconG", "demoIconG"])
  42.   if the machineType = 256 then
  43.     setSound(gControlButs, "downSound1")
  44.   else
  45.     setSound(gControlButs, "downSound1", "upSound1")
  46.   end if
  47.   set gMenuButs to new(script "buttonMan", [2, 3, 4, 5], ["sideIcon1", "sideIcon2", "sideIcon3", "sideIcon4"])
  48.   setType(gMenuButs, "radio")
  49.   setDownList(gMenuButs, ["sideIcon1D", "sideIcon2D", "sideIcon3D", "sideIcon4D"])
  50.   setOverList(gMenuButs, ["sideIcon1R", "sideIcon2R", "sideIcon3R", "sideIcon4R"])
  51.   setSound(gMenuButs, "downSound3")
  52.   set gNavigator to new(script "NavigationMgr")
  53.   addMarker(gNavigator, "Welcome", [gMenuButs, gControlButs], [0, 0])
  54.   addMarker(gNavigator, "LivingBooks", [gMenuButs, gLivBookButs, gControlButs], [1, 0, 0])
  55.   addMarker(gNavigator, "Grandma", [gMenuButs, gLivBookButs, gControlButs], [1, 1, 0])
  56.   addMarker(gNavigator, "Tortoise", [gMenuButs, gLivBookButs, gControlButs], [1, 2, 0])
  57.   addMarker(gNavigator, "SheilaRae", [gMenuButs, gLivBookButs, gControlButs], [1, 3, 0])
  58.   addMarker(gNavigator, "LittleMonster", [gMenuButs, gLivBookButs, gControlButs], [1, 4, 0])
  59.   addMarker(gNavigator, "Harry", [gMenuButs, gLivBookButs, gControlButs], [1, 5, 0])
  60.   addMarker(gNavigator, "Birthday", [gMenuButs, gLivBookButs, gControlButs], [1, 6, 0])
  61.   addMarker(gNavigator, "Broderbund", [gMenuButs, gBroderbundButs, gControlButs], [2, 0, 0])
  62.   addMarker(gNavigator, "MathWorkshop", [gMenuButs, gBroderbundButs, gControlButs], [2, 3, 0])
  63.   addMarker(gNavigator, "Zoombinis", [gMenuButs, gBroderbundButs, gControlButs], [2, 2, 0])
  64.   addMarker(gNavigator, "KidPix", [gMenuButs, gBroderbundButs, gControlButs], [2, 1, 0])
  65.   addMarker(gNavigator, "CarmenWorld", [gMenuButs, gBroderbundButs, gControlButs], [2, 6, 0])
  66.   addMarker(gNavigator, "CarmenJunior", [gMenuButs, gBroderbundButs, gControlButs], [2, 4, 0])
  67.   addMarker(gNavigator, "PrintShop", [gMenuButs, gBroderbundButs, gControlButs], [2, 5, 0])
  68.   addMarker(gNavigator, "ClickArt", [gMenuButs, gBroderbundButs, gControlButs], [2, 7, 0])
  69.   addMarker(gNavigator, "WorkSheet", [gMenuButs, gControlButs], [3, 0])
  70.   addMarker(gNavigator, "OrderInfo", [gMenuButs, gControlButs, gSupplierButs], [4, 0, 0])
  71.   addMarker(gNavigator, "RM", [gMenuButs, gControlButs, gBackBut], [4, 0, 0])
  72.   addMarker(gNavigator, "SCET", [gMenuButs, gControlButs, gBackBut], [4, 0, 0])
  73.   addMarker(gNavigator, "TAG", [gMenuButs, gControlButs, gBackBut], [4, 0, 0])
  74.   addMarker(gNavigator, "Xemplar", [gMenuButs, gControlButs, gBackBut], [4, 0, 0])
  75.   addMarker(gNavigator, "Credits", [gMenuButs, gControlButs], [0, 0])
  76.   addMarker(gNavigator, "quit", [])
  77.   set fd to fileDelimiter()
  78.   set gDemoInfo to new(script "demoMgr")
  79.   addDemo(gDemoInfo, "Zoombinis", the pathName & "Zoombini" & fd & "pizza" & fd & "zoom", "movie")
  80.   addDemo(gDemoInfo, "CarmenWorld", the pathName & "Carmen" & fd & "_CARMWLD", "movie")
  81.   addDemo(gDemoInfo, "CarmenJunior", the pathName & "CarmenJR" & fd & "CarmenJR", "movie")
  82.   addDemo(gDemoInfo, "MathWorkshop", the pathName & "mathwork" & fd & "mathwork", "movie")
  83.   addDemo(gDemoInfo, "KidPix", the pathName & "kid_pix" & fd & "moopies" & fd & "kid_pix", "movie")
  84.   addDemo(gDemoInfo, "Grandma", the pathName & "JGM" & fd & "JMCOVERB", "movie")
  85.   addDemo(gDemoInfo, "Harry", the pathName & "HHH" & fd & "HHCOVERB", "movie")
  86.   addDemo(gDemoInfo, "Birthday", the pathName & "AB" & fd & "ABCOVERB", "movie")
  87.   addDemo(gDemoInfo, "LittleMonster", the pathName & "LMAS" & fd & "LMCOVERB", "movie")
  88.   addDemo(gDemoInfo, "Tortoise", the pathName & "TTAH" & fd & "THCOVERB", "movie")
  89.   addDemo(gDemoInfo, "SheilaRae", the pathName & "SRAE" & fd & "SRCOVERB", "movie")
  90.   set gPrintInfo to new(script "printMgr")
  91.   addPrintSection(gPrintInfo, "Grandma", "product", ["LBPrintTitle", "JGMPrint"])
  92.   addPrintSection(gPrintInfo, "Tortoise", "product", ["LBPrintTitle", "TTHPrint"])
  93.   addPrintSection(gPrintInfo, "SheilaRae", "product", ["LBPrintTitle", "SRBPrint"])
  94.   addPrintSection(gPrintInfo, "LittleMonster", "product", ["LBPrintTitle", "LMSPrint"])
  95.   addPrintSection(gPrintInfo, "Harry", "product", ["LBPrintTitle", "HHHPrint"])
  96.   addPrintSection(gPrintInfo, "Birthday", "product", ["LBPrintTitle", "ABPrint"])
  97.   addPrintSection(gPrintInfo, "MathWorkshop", "product", ["BrodPrintTitle", "MWPrint"])
  98.   addPrintSection(gPrintInfo, "Zoombinis", "product", ["BrodPrintTitle", "ZPrint"])
  99.   addPrintSection(gPrintInfo, "CarmenWorld", "product", ["BrodPrintTitle", "CWPrint"])
  100.   addPrintSection(gPrintInfo, "CarmenJunior", "product", ["BrodPrintTitle", "CJPrint"])
  101.   addPrintSection(gPrintInfo, "PrintShop", "product", ["BrodPrintTitle", "PSPrint"])
  102.   addPrintSection(gPrintInfo, "ClickArt", "product", ["BrodPrintTitle", "CAPrint"])
  103.   addPrintSection(gPrintInfo, "KidPix", "product", ["BrodPrintTitle", "KPPrint"])
  104.   addPrintSection(gPrintInfo, "TAG", "OrderForm", ["OFPrintTitle", "orderFormPrint"])
  105.   set gDialog to new(script "dialogMgr")
  106.   setProperties(gDialog, "quit", "dQuit", ["goQuit", "nothing"])
  107.   setProperties(gDialog, "product", "dPrintP", ["printInfo", "nothing"])
  108.   setProperties(gDialog, "WorkSheet", "dPrintW", ["printInfo", "nothing"])
  109.   setProperties(gDialog, "OrderForm", "dPrintOF", ["printInfo", "nothing"])
  110.   set gMusicPlayer to new(script "musicMgr", 3, 40, ["CJR", "KPX", "MWS1", "MWS2", "ZMB", "CWD", "PSP"])
  111.   if the freeBlock > (2 * 1024 * 1024) then
  112.     setState(gMusicPlayer, 1)
  113.   end if
  114. end
  115.  
  116. on keyDown
  117.   checkKeyboardExit()
  118. end
  119.  
  120. on checkKeyboardExit
  121.   if not gKeyboardExit then
  122.     exit
  123.   end if
  124.   set QuitMe to 0
  125.   if the keyCode = 53 then
  126.     set QuitMe to 1
  127.   end if
  128.   if the commandDown and ((the key = ".") or (the key = "q")) then
  129.     set QuitMe to 1
  130.   end if
  131.   if QuitMe = 1 then
  132.     openDialog("quit")
  133.   end if
  134. end
  135.  
  136. on fileDelimiter
  137.   if the platform contains "Windows" then
  138.     return "\"
  139.   else
  140.     return ":"
  141.   end if
  142. end
  143.  
  144. on setPaletteCast
  145.   if the platform contains "Windows" then
  146.     set the fileName of castLib "Palettes" to the pathName & "PCPal"
  147.   else
  148.     set the fileName of castLib "Palettes" to the pathName & "MacPal"
  149.   end if
  150. end
  151.  
  152. on setMonitorDepth theState
  153.   if theState = "start" then
  154.     if the colorDepth <> 8 then
  155.       if the platform contains "Windows" then
  156.         alert(the text of member "MonitorAlertWin")
  157.         quit()
  158.       else
  159.         alert(the text of member "MonitorAlertMac")
  160.         set gColorDepth to the colorDepth
  161.         set the colorDepth to 8
  162.       end if
  163.     end if
  164.   else
  165.     if the platform contains "Macintosh" then
  166.       if gColorDepth <> EMPTY then
  167.         set the colorDepth to gColorDepth
  168.       end if
  169.     end if
  170.   end if
  171. end
  172.  
  173. on checkQuickTime
  174.   if not (the quickTimePresent) then
  175.     alert(the text of member "QuickTimeAlert")
  176.     quit()
  177.   end if
  178. end
  179.  
  180. on goQuit
  181.   set gKeyboardExit to 0
  182.   set the actorList to []
  183.   goMarker(gNavigator, "quit")
  184. end
  185.  
  186. on printInfo
  187.   printInfo(gPrintInfo, getMarker(gNavigator))
  188. end
  189.  
  190. on openDialog theName
  191.   set theObjectList to getObjectList(gNavigator)
  192.   repeat with r in theObjectList
  193.     set index to getOne(the actorList, r)
  194.     if index > 0 then
  195.       deleteAt(the actorList, index)
  196.     end if
  197.   end repeat
  198.   set the mouseDownScript to "closeDialog"
  199.   set the mouseUpScript to "dontPassEvent"
  200.   show(gDialog, theName)
  201. end
  202.  
  203. on closeDialog
  204.   if the doubleClick then
  205.     exit
  206.   end if
  207.   dispose(gDialog)
  208.   set theObjectList to getObjectList(gNavigator)
  209.   repeat with r in theObjectList
  210.     set index to getOne(the actorList, r)
  211.     if index = 0 then
  212.       append(the actorList, r)
  213.     end if
  214.   end repeat
  215.   set the mouseDownScript to EMPTY
  216.   set the mouseUpScript to EMPTY
  217. end
  218.  
  219. on initCorporateGlobals
  220.   set gCorpDemo to "PICKER DemoNone"
  221.   set gPickerPath to the pathName & the movieName
  222.   if voidp(gLastDemo) then
  223.     set gLastDemo to EMPTY
  224.   end if
  225.   if voidp(gColorDepth) then
  226.     set gColorDepth to EMPTY
  227.   end if
  228.   if voidp(gCorpVolume) then
  229.     set gCorpVolume to 1
  230.   end if
  231.   if voidp(gReturnFrame) then
  232.     set gReturnFrame to EMPTY
  233.   end if
  234. end
  235.  
  236. on timedEvent Howlong, theAction
  237.   set gTimer to EMPTY
  238.   set gTimer to new(script "timerObj", Howlong, theAction)
  239. end
  240.  
  241. on fadeOutAllSounds
  242.   sound fadeOut 1, 60
  243.   sound fadeOut 2, 60
  244.   sound fadeOut 3, 60
  245.   sound fadeOut 4, 60
  246. end
  247.  
  248. on StartDemo
  249.   set demoName to getMarker(gNavigator)
  250.   set demoPath to demoPath(gDemoInfo, demoName)
  251.   set gReturnFrame to demoName
  252.   cleanup()
  253.   go("goToDemo")
  254.   go(1, demoPath)
  255. end
  256.  
  257. on returnFromDemo
  258.   setMarker(gNavigator, EMPTY)
  259.   goMarker(gNavigator, gReturnFrame)
  260.   set gKeyboardExit to 1
  261. end
  262.  
  263. on cleanup
  264.   set the actorList to []
  265.   puppetSound(1, 0)
  266.   puppetSound(2, 0)
  267.   puppetSound(3, 0)
  268.   puppetSound(4, 0)
  269.   set the timeoutScript to EMPTY
  270.   set the timeoutLength to 0
  271.   set the timeoutLapsed to 0
  272.   set the timeoutKeyDown to 1
  273.   set the timeoutMouse to 1
  274.   set the timeoutPlay to 0
  275.   set the mouseDownScript to EMPTY
  276.   set the mouseUpScript to EMPTY
  277.   set the keyDownScript to EMPTY
  278.   set the keyUpScript to EMPTY
  279.   set the exitLock to 0
  280.   set CorpDemo to gCorpDemo
  281.   set PickerPath to gPickerPath
  282.   set CorpDemoList to gCorpDemoList
  283.   set LastDemo to gLastDemo
  284.   set colorDepth to gColorDepth
  285.   set corpVolume to gCorpVolume
  286.   set returnFrame to gReturnFrame
  287.   clearGlobals()
  288.   if not voidp(gReturnFrame) then
  289.     unlaodmember()
  290.   end if
  291.   set gCorpDemo to CorpDemo
  292.   set gPickerPath to PickerPath
  293.   set gCorpDemoList to CorpDemoList
  294.   set gLastDemo to LastDemo
  295.   set gColorDepth to colorDepth
  296.   set gCorpVolume to corpVolume
  297.   set gReturnFrame to returnFrame
  298.   puppetPalette(0)
  299.   unPuppetAll()
  300. end
  301.  
  302. on unPuppetAll
  303.   repeat with i = 1 to 48
  304.     puppetSprite(i, 0)
  305.   end repeat
  306. end
  307.